<template>
  <div class="emr-content-module module-personality">
    <h3 id="personality">
      现病史
      <!-- <svg-icon icon-class="question" /> -->
    </h3>
    <h3 style="display: block">
      反复发作性
      <el-popover
        placement="right"
        title="反复发作性"
        :width="300"
        trigger="hover"
      >
        <div>孩子从什么时候开始出现反复咳嗽/咳喘发作？</div>
        <div>到现在孩子已经咳嗽/咳喘几次呢？</div>
        <div>过去1年发作过几次？记得每次发作大概在什么月份吗？</div>
        <div>过去3个月发作过几次？</div>
        <div>每次发作症状迁延大概多久？最短几天？最长几天？</div>
        <div>
          孩子有没有因为比较严重咳喘发作要去急诊或住院治疗？或者门诊医生开激素口服或打激素针？总共有多少次这种比较严重的？过去半年有过几次？
        </div>
        <div>在过去4周或更长时间，是否每周有症状并需要治疗?</div>
        <div>过去4周大概有几天有咳嗽/咳喘症状？</div>
        <div>过去4周大概有几天因为咳嗽/咳喘需要使用药物治疗的？</div>
        <div>
          最近这一次发作只是咳嗽，还是咳嗽伴有气喘？咳嗽是干咳还是伴有痰音？孩子有没有胸闷、气促等其他症状？
        </div>
        <div>这次发作有无发热？如果有，最高体温多少度？</div>
        <div>有无流鼻涕、鼻塞等感冒样症状？</div>
        <div>咳喘发作之前有没有吃东西呛过？</div>
        <div>
          有无用过抗菌素治疗？比如，青霉素类（例如阿莫西林）、头孢类（例如希克劳）、阿奇霉素等？
        </div>
        <template #reference>
          <svg-icon icon-class="question" />
        </template>
      </el-popover>
    </h3>
    <div class="content-wrapper" :class="{ locked: d.disabled }">
      <div>患儿自</div>
      <el-select
        clearable
        size="medium"
        :disabled="d.disabled"
        v-model="d.presentIllnessHistory.startYear"
        v-if="!d.disabled"
        placeholder=""
        style="width: 5rem"
      >
        <el-option
          v-for="item in FULLYEARS"
          :value="item + ''"
          :key="'YEARS_KEY_' + item"
        >
          {{ item }}
        </el-option>
      </el-select>
      年
      <el-select
        clearable
        size="medium"
        :disabled="d.disabled"
        v-model="d.presentIllnessHistory.startMonth"
        placeholder=""
        style="width: 4rem"
      >
        <el-option
          v-for="item in MONTHS"
          :value="item + ''"
          :key="'YEARS_KEY_' + item"
        >
          {{ item }}
        </el-option>
      </el-select>
      月开始出现

      <el-checkbox
        size="medium"
        :disabled="d.disabled"
        v-model="d.presentIllnessHistory.cough"
      >
        反复咳嗽
      </el-checkbox>
      ,

      <el-checkbox
        size="medium"
        :disabled="d.disabled"
        v-model="d.presentIllnessHistory.wheezing"
      >
        伴喘息发作
      </el-checkbox>
      , 至今共发作
      <el-input
        v-model="d.presentIllnessHistory.timesInTotal"
        placeholder=""
        :disabled="d.disabled"
        size="medium"
        maxlength="4"
        style="width: 4rem"
        v-number:2
      ></el-input>
      次, 过去1年共发作
      <el-input
        v-model="d.presentIllnessHistory.timesInPastYears"
        placeholder=""
        :disabled="d.disabled"
        size="medium"
        maxlength="4"
        style="width: 4rem"
        v-number:2
      ></el-input>
      次，
      <template>
        近3个月共发作
        <el-input
          v-model="d.presentIllnessHistory.timesInRecentMonths"
          placeholder=""
          :disabled="d.disabled"
          size="medium"
          maxlength="4"
          style="width: 4rem"
          v-number:2
        ></el-input>
        次，
      </template>

      <span class="inline-block">
        每次发作症状迁延时间
        <el-input
          size="medium"
          :disabled="d.disabled"
          placeholder="包括咳嗽等症状"
          maxlength="10"
          v-model="d.presentIllnessHistory.rePhlegmTime"
          style="width: 6rem"
          v-number:2
        ></el-input>
        天，
      </span>
      是否有需要使用全身糖皮质激素、急诊、住院的急性发作:
      <el-radio-group
        class="inline-block"
        :disabled="d.disabled"
        @change="d.presentIllnessHistory.breakOutInSixMonth = ''"
        v-model="d.presentIllnessHistory.breakOutAcute"
      >
        <el-radio label="0">无</el-radio>
        <el-radio label="1">有</el-radio>
      </el-radio-group>
      <span
        class="inline-block"
        v-if="d.presentIllnessHistory.breakOutAcute === '1'"
      >
        这种严重发作曾在6个月内发作
        <el-input
          v-model="d.presentIllnessHistory.breakOutInSixMonth"
          placeholder=""
          :disabled="d.disabled"
          size="medium"
          maxlength="4"
          style="width: 4rem"
          v-number:2
        ></el-input>
        次
      </span>

      <template>
        ，过去4周或更长时间，是否每周都有症状且每周需要治疗的天数均>2天
        <el-radio-group
          class="inline-block"
          :disabled="d.disabled"
          @change="d.presentIllnessHistory.treatDaysEachWeek = ''"
          v-model="d.presentIllnessHistory.treatEachWeek"
        >
          <el-radio label="0">无</el-radio>
          <el-radio label="1">有</el-radio>
        </el-radio-group>
      </template>

      。 过去4周共有咳嗽
      <el-input
        v-model="d.presentIllnessHistory.coughInPastFourWeek"
        placeholder=""
        :disabled="d.disabled"
        size="medium"
        maxlength="4"
        style="width: 4rem"
        v-number:2
      ></el-input>
      天/喘息发作
      <el-input
        v-model="d.presentIllnessHistory.wheezInPastFourWeek"
        placeholder=""
        :disabled="d.disabled"
        size="medium"
        maxlength="4"
        style="width: 4rem"
        v-number:2
      ></el-input>
      次；过去4周需要使用药物缓解咳嗽/咳喘症状总有
      <el-input
        v-model="d.presentIllnessHistory.laxationInPastFourWeek"
        placeholder=""
        :disabled="d.disabled"
        size="medium"
        maxlength="4"
        style="width: 4rem"
        v-number:2
      ></el-input>
      次。 近
      <el-input
        v-model="d.presentIllnessHistory.daysRecent"
        placeholder=""
        :disabled="d.disabled"
        size="medium"
        maxlength="4"
        style="width: 4rem"
        v-number:2
      ></el-input>
      天再次出现
      <el-checkbox
        size="medium"
        :disabled="d.disabled"
        v-model="d.presentIllnessHistory.reCough"
      >
        咳嗽、
      </el-checkbox>
      <el-checkbox
        size="medium"
        :disabled="d.disabled"
        v-model="d.presentIllnessHistory.reWheezing"
      >
        喘息、
      </el-checkbox>
      <el-checkbox
        size="medium"
        :disabled="d.disabled"
        v-model="d.presentIllnessHistory.reChestTightness"
      >
        胸闷、
      </el-checkbox>
      <el-checkbox
        size="medium"
        :disabled="d.disabled"
        v-model="d.presentIllnessHistory.reShortnessBreath"
      >
        气促、
      </el-checkbox>
      <el-checkbox
        size="medium"
        :disabled="d.disabled"
        v-model="d.presentIllnessHistory.reExpectoration"
        @change="d.presentIllnessHistory.reExpectorationColor = null"
      >
        咳痰
      </el-checkbox>

      <el-radio-group
        :disabled="d.disabled"
        v-if="d.presentIllnessHistory.reExpectoration"
        v-model="d.presentIllnessHistory.reExpectorationColor"
      >
        （
        <el-radio size="medium" label="yellow" :disabled="d.disabled">
          黄痰、
        </el-radio>
        <el-radio size="medium" label="white" :disabled="d.disabled">
          白痰
        </el-radio>
        ）
      </el-radio-group>
      、

      <el-checkbox
        size="medium"
        :disabled="d.disabled"
        v-model="d.presentIllnessHistory.rePhlegm"
      >
        痰鸣,
      </el-checkbox>
      是否有发热
      <el-radio-group
        :disabled="d.disabled"
        class="inline-block"
        v-model="d.presentIllnessHistory.hasFever"
        @change="d.presentIllnessHistory.temperature = null"
      >
        <el-radio label="0">无</el-radio>
        <el-radio label="1">有</el-radio>
      </el-radio-group>
      <span class="inline-block" v-if="d.presentIllnessHistory.hasFever">
        体温
        <el-input
          size="medium"
          :disabled="d.disabled"
          placeholder="体温"
          v-model="d.presentIllnessHistory.temperature"
          style="width: 4rem"
          v-number:2
        ></el-input>
        °C
      </span>
      ，是否有流鼻涕

      <el-radio-group
        :disabled="d.disabled"
        class="inline-block"
        v-model="d.presentIllnessHistory.hasMucus"
      >
        <el-radio label="0">无</el-radio>
        <el-radio label="1">有</el-radio>
      </el-radio-group>
      ，喘息之前是否有吃东西呛过

      <el-radio-group
        :disabled="d.disabled"
        class="inline-block"
        @change="d.presentIllnessHistory.chokeRemark = ''"
        v-model="d.presentIllnessHistory.hasChokeBefore"
      >
        <el-radio label="0">无</el-radio>
        <el-radio label="1">有</el-radio>
      </el-radio-group>
      <el-input
        size="medium"
        v-if="d.presentIllnessHistory.hasChokeBefore === '1'"
        :disabled="d.disabled"
        placeholder="描述具体情况"
        v-model="d.presentIllnessHistory.chokeRemark"
        style="width: 9rem"
      ></el-input>
      。 最近一次发作是否有使用抗生素治疗
      <el-radio-group
        :disabled="d.disabled"
        class="inline-block"
        @change="clear(['usingAntibioticDays', 'isAntibioticWork'])"
        v-model="d.presentIllnessHistory.hasUseAntibiotic"
      >
        <el-radio label="0">无</el-radio>
        <el-radio label="1">有</el-radio>
      </el-radio-group>

      <template v-if="d.presentIllnessHistory.hasUseAntibiotic">
        ，使用了
        <el-input
          size="medium"
          :disabled="d.disabled"
          placeholder=""
          maxlength="3"
          v-model="d.presentIllnessHistory.usingAntibioticDays"
          style="width: 4rem"
          v-number:2
        ></el-input>
        天
      </template>
      <template v-if="d.presentIllnessHistory.hasUseAntibiotic">
        ，
        <el-radio-group
          :disabled="d.disabled"
          class="inline-block"
          v-model="d.presentIllnessHistory.isAntibioticWork"
        >
          <el-radio label="0">无效</el-radio>
          <el-radio label="1">有效</el-radio>
        </el-radio-group>
      </template>
      。
      <el-input
        size="medium"
        type="textarea"
        :disabled="d.disabled"
        placeholder="补充内容,限制100个字符以内 "
        :maxlength="100"
        :autosize="{ minRows: 1, maxRows: 4 }"
        v-model="d.presentIllnessHistory.others1"
        style="margin-top: 0.5rem"
      ></el-input>
    </div>

    <h3>
      诱因多样性
      <el-popover
        placement="right"
        title="诱因多样性"
        :width="300"
        trigger="hover"
      >
        <div>1. 每次发作是不是都先有流涕、喷嚏、鼻塞或者发烧等感冒症状？</div>
        <div>2. 有无试过没有感冒的情况下突然出现咳喘症状？</div>
        <div>
          3.
          有没有注意到孩子的咳喘与接触哪些因素有关？比如进食某种食物（包括甜的、冷的）、与动物接触玩耍、闻到很浓的气味
          （例如：油漆味,、香水味、身边有人抽烟）、或天气转冷时？
        </div>
        <div>4. 孩子在大笑、大叫、哭闹、较剧烈跑跳时会出现咳嗽或气喘吗？</div>
        <div>
          5. 孩子会不会在跑动或玩耍过程中因为咳嗽、气喘或气促被迫停下来？
        </div>
        <div>
          6. 有无正常上体育课？跑步会不会比大多数同学慢？跑步测验达标吗？'
        </div>
        <template #reference>
          <svg-icon icon-class="question" />
        </template>
      </el-popover>
    </h3>
    <div class="content-wrapper" :class="{ locked: d.disabled }">
      每次发作的诱发因素
      <span class="inline-block">
        <el-checkbox-group v-model="d.presentIllnessHistory.causeChecks">
          <el-checkbox size="medium" label="cold" :disabled="d.disabled">
            感冒
          </el-checkbox>
          <el-checkbox size="medium" label="movement" :disabled="d.disabled">
            剧烈运动
          </el-checkbox>
          <el-checkbox size="medium" label="yell" :disabled="d.disabled">
            大叫、大笑
          </el-checkbox>
          <el-checkbox size="medium" label="scream" :disabled="d.disabled">
            哭闹
          </el-checkbox>
          <el-checkbox size="medium" label="takeFood" :disabled="d.disabled">
            进食甜食或冷冻食品饮料
          </el-checkbox>
          <el-checkbox
            size="medium"
            label="climateChange"
            :disabled="d.disabled"
          >
            气候变化
          </el-checkbox>
          <el-checkbox
            size="medium"
            label="touchAnimals"
            :disabled="d.disabled"
            @change="clear('touchAnimalsContent')"
          >
            接触动物
            <el-input
              maxlength="50"
              style="width: 160px"
              v-if="
                d.presentIllnessHistory.causeChecks.includes('touchAnimals')
              "
              size="small"
              placeholder="如：猫、狗、其他"
              v-model="d.presentIllnessHistory.touchAnimalsContent"
            ></el-input>
          </el-checkbox>
          <el-checkbox
            size="medium"
            label="strongSmell"
            :disabled="d.disabled"
            @change="clear('stongSmellContent')"
          >
            闻到浓烈的气味
            <el-input
              maxlength="50"
              v-if="d.presentIllnessHistory.causeChecks.includes('strongSmell')"
              size="small"
              style="width: 160px"
              placeholder="如：油漆、香水、烟味、其他"
              v-model="d.presentIllnessHistory.stongSmellContent"
            ></el-input>
          </el-checkbox>
        </el-checkbox-group>
      </span>
      <div>
        <div style="display: inline-block">
          孩子有否在跑动或玩耍过程中因为咳嗽、气喘或气促被迫停下来：
        </div>
        <span class="inline-block">
          <el-radio-group
            :disabled="d.disabled"
            class="inline-block"
            @change="clear('appearInPastFourWeek')"
            v-model="d.presentIllnessHistory.forcedStopByCough"
          >
            <el-radio label="0">否</el-radio>
            <el-radio label="1">有</el-radio>
          </el-radio-group>
          <template v-if="d.presentIllnessHistory.forcedStopByCough === '1'">
            ，近4周是否有出现
            <el-radio-group
              :disabled="d.disabled"
              class="inline-block"
              v-model="d.presentIllnessHistory.appearInPastFourWeek"
            >
              <el-radio label="0">否</el-radio>
              <el-radio label="1">是</el-radio>
            </el-radio-group>
          </template>
          。
        </span>

        <!-- 先去掉年龄跑起来 -->
        <template v-if="ageType === 'greaterEqual'">
          <span class="inline-block">
            是否正常上体育课：
            <el-radio-group
              :disabled="d.disabled"
              class="inline-block"
              v-model="d.presentIllnessHistory.normalInPE"
            >
              <el-radio label="0">否</el-radio>
              <el-radio label="1">有</el-radio>
            </el-radio-group>
            ，跑步是否比大多数同学慢：
            <el-radio-group
              :disabled="d.disabled"
              class="inline-block"
              v-model="d.presentIllnessHistory.isRunSlower"
            >
              <el-radio label="0">否</el-radio>
              <el-radio label="1">是</el-radio>
            </el-radio-group>
            ，跑步测验是否达标：
            <el-radio-group
              :disabled="d.disabled"
              class="inline-block"
              v-model="d.presentIllnessHistory.passRunningTest"
            >
              <el-radio label="0">否</el-radio>
              <el-radio label="1">是</el-radio>
            </el-radio-group>
            。
          </span>
        </template>
      </div>
      <el-input
        size="medium"
        type="textarea"
        :disabled="d.disabled"
        placeholder="补充内容,限制100个字符以内 "
        :maxlength="100"
        :autosize="{ minRows: 1, maxRows: 4 }"
        v-model="d.presentIllnessHistory.others2"
        style="margin-top: 0.5rem"
      ></el-input>
    </div>

    <h3>
      时间节律性
      <el-popover
        placement="right"
        title="时间节律性"
        :width="300"
        trigger="hover"
      >
        <div>1. 咳喘症状会不会早上起床时或晚上尤其是睡着后好发或加重？</div>
        <div>
          2. 孩子会不会在夜睡过程中因为咳嗽、气喘、或“喘不过气来”而醒来？
        </div>
        <template #reference>
          <svg-icon icon-class="question" />
        </template>
      </el-popover>
    </h3>
    <div class="content-wrapper" :class="{ locked: d.disabled }">
      <el-checkbox
        size="medium"
        :disabled="d.disabled"
        v-model="d.presentIllnessHistory.morning"
      >
        症状晨起好发或加重
      </el-checkbox>
      <el-checkbox
        size="medium"
        :disabled="d.disabled"
        v-model="d.presentIllnessHistory.evening"
      >
        症状晚上尤其是入睡后好发或加重
      </el-checkbox>
      <br />
      <div>
        <div style="display: inline-block">
          过去4周睡眠过程中有否曾经因为咳嗽、气喘醒来
        </div>
        <el-radio-group
          :disabled="d.disabled"
          v-model="d.presentIllnessHistory.wakeUpByAsthma"
        >
          <el-radio label="0">无</el-radio>
          <el-radio label="1">有</el-radio>
        </el-radio-group>
      </div>
      <el-input
        size="medium"
        type="textarea"
        :disabled="d.disabled"
        placeholder="补充内容,限制100个字符以内 "
        :maxlength="100"
        :autosize="{ minRows: 1, maxRows: 4 }"
        v-model="d.presentIllnessHistory.others3"
        style="margin-top: 0.5rem"
      ></el-input>
    </div>

    <div class="h3">
      季节性
      <el-popover placement="right" title="季节性" :width="300" trigger="hover">
        <div>
          1. 孩子的咳喘会不会在某个季节容易发病或更加严重（如秋冬季、春季）？
        </div>
        <template #reference>
          <svg-icon icon-class="question" />
        </template>
      </el-popover>
    </div>
    <div class="content-wrapper" :class="{ locked: d.disabled }">
      <el-radio-group
        :disabled="d.disabled"
        @change="clear('seasonChecks')"
        v-model="d.presentIllnessHistory.seasonCorrelation"
      >
        <el-radio size="medium" label="0" :disabled="d.disabled">否</el-radio>
        <el-radio size="medium" label="1" :disabled="d.disabled">是</el-radio>
      </el-radio-group>
      <span
        class="inline-block"
        v-if="d.presentIllnessHistory.seasonCorrelation === '1'"
      >
        <el-checkbox-group v-model="d.presentIllnessHistory.seasonChecks">
          在某些季节容易发病，好发季节
          <el-checkbox size="medium" label="spring" :disabled="d.disabled">
            春季
          </el-checkbox>
          <el-checkbox size="medium" label="summer" :disabled="d.disabled">
            夏季
          </el-checkbox>
          <el-checkbox size="medium" label="fall" :disabled="d.disabled">
            秋季
          </el-checkbox>
          <el-checkbox size="medium" label="winter" :disabled="d.disabled">
            冬季
          </el-checkbox>
        </el-checkbox-group>
      </span>
      <el-input
        size="medium"
        type="textarea"
        :disabled="d.disabled"
        placeholder="补充内容,限制100个字符以内 "
        :maxlength="100"
        :autosize="{ minRows: 1, maxRows: 4 }"
        v-model="d.presentIllnessHistory.others4"
        style="margin-top: 0.5rem"
      ></el-input>
    </div>

    <div class="h3">
      可逆性
      <el-popover placement="right" title="可逆性" :width="300" trigger="hover">
        <div>
          1. 孩子有咳嗽/咳喘症状的时候通常使用什么药物治疗？有无做过雾化治疗？
        </div>
        <div>
          1.1.
          知道具体用过什么药物吗？有无雾化过激素类药物（例如：布地奈德、丙酸氟替卡松、二丙酸倍氯米松）？
          有无雾化过支气管扩张剂（例如：沙丁胺醇、特布他林、爱全乐、可必特）？
        </div>
        <div>
          1.2.
          一般雾化会坚持做多长时间？症状好了就停药，还是无症状也坚持用药？最长用了多长时间？（或者至今已用了多长时间？）
        </div>
        <div>1.3. 你觉得做雾化有效吗？</div>
        <div>2.孩子有吸过气雾剂或干粉剂治疗吗？</div>
        <div>
          2.1.
          用过哪种气雾剂或干粉剂？例如：橙色的或咖啡色的气雾剂（丙酸氟替卡松、布地奈德）；
          蓝色的气雾剂（沙丁胺醇、特布他林）？红色的或紫色的干粉剂（信必可都保、舒利迭干粉剂）？
        </div>
        <div>2.2. 孩子用这种气雾剂（干粉剂）多长时间了？</div>
        <div>2.3. 你觉得孩子吸这些药有效吗？</div>
        <div>3.孩子有口服过白三烯受体拮抗剂（例如：顺尔宁）治疗吗？</div>
        <div>3.1. 最长用了多久？</div>
        <div>3.2. 你觉得孩子吃这种药有效吗？</div>
        <div>4. 两次咳嗽/咳喘发作之间会不会有一段时间完全无症状的？</div>
        <template #reference>
          <svg-icon icon-class="question" />
        </template>
      </el-popover>
    </div>
    <div class="content-wrapper" :class="{ locked: d.disabled }">
      <div>
        <div style="display: inline-block">是否使用过哮喘药物治疗</div>
        <el-radio-group
          :disabled="d.disabled"
          v-model="d.presentIllnessHistory.isAsthmaCured"
          @change="
            clear([
              'relieverUseYears',
              'relieverUseMonths',
              'relieverUseWeeks',
              'relieverUseDays',
              'relieverWork',
              'useYears',
              'useMonths',
              'useWeeks',
              'useDays',
              'controllerMedicantWork',
              'pauseBetweenCause',
            ])
          "
        >
          <el-radio size="medium" :disabled="d.disabled" label="0">无</el-radio>
          <el-radio size="medium" :disabled="d.disabled" label="1">有</el-radio>
        </el-radio-group>
      </div>
      <template v-if="d.presentIllnessHistory.isAsthmaCured === true">
        <div>既往哮喘药物治疗情况</div>
        <div>
          缓解药物(待补) ， 使用
          <el-select
            clearable
            size="medium"
            :disabled="d.disabled"
            v-model="d.presentIllnessHistory.relieverUseYears"
            placeholder=" "
            style="width: 70px"
          >
            <el-option
              v-for="item in YEARS"
              :value="item"
              :key="'YEARS_KEY_' + item"
            >
              {{ item }}
            </el-option>
          </el-select>
          年
          <el-select
            clearable
            size="medium"
            :disabled="d.disabled"
            v-model="d.presentIllnessHistory.relieverUseMonths"
            placeholder=" "
            style="width: 70px"
          >
            <el-option
              v-for="item in YEARS"
              :value="item"
              :key="'YEARS_KEY_' + item"
            >
              {{ item }}
            </el-option>
          </el-select>
          月
          <el-select
            clearable
            size="medium"
            :disabled="d.disabled"
            v-model="d.presentIllnessHistory.relieverUseWeeks"
            placeholder=""
            style="width: 70px"
          >
            <el-option
              v-for="item in YEARS"
              :value="item"
              :key="'YEARS_KEY_' + item"
            >
              {{ item }}
            </el-option>
          </el-select>
          周
          <el-select
            clearable
            size="medium"
            :disabled="d.disabled"
            v-model="d.presentIllnessHistory.relieverUseDays"
            placeholder=""
            style="width: 70px"
          >
            <el-option
              v-for="item in DAYS"
              :value="item"
              :key="'YEARS_KEY_' + item"
            >
              {{ item }}
            </el-option>
          </el-select>
          日
          <el-radio-group
            :disabled="d.disabled"
            v-model="d.presentIllnessHistory.relieverWork"
          >
            <el-radio size="medium" :label="true" :disabled="d.disabled">
              有效
            </el-radio>
            <el-radio size="medium" :label="false" :disabled="d.disabled">
              无效
            </el-radio>
          </el-radio-group>
          。
        </div>
        <div>
          控制药物(缺，待补) ， 使用
          <el-select
            clearable
            size="medium"
            :disabled="d.disabled"
            v-model="d.presentIllnessHistory.useYears"
            placeholder=" "
            style="width: 70px"
          >
            <el-option
              v-for="(item, index) in YEARS"
              :value="index"
              :label="item"
              :key="'YEARS_KEY_' + index"
            ></el-option>
          </el-select>
          年
          <el-select
            clearable
            size="medium"
            :disabled="d.disabled"
            v-model="d.presentIllnessHistory.useMonths"
            placeholder=" "
            style="width: 70px"
          >
            <el-option
              v-for="(item, index) in YEARS"
              :value="index"
              :label="item"
              :key="'YEARS_KEY_' + index"
            ></el-option>
          </el-select>
          月
          <el-select
            clearable
            size="medium"
            :disabled="d.disabled"
            v-model="d.presentIllnessHistory.useWeeks"
            placeholder=""
            style="width: 70px"
          >
            <el-option
              v-for="(item, index) in YEARS"
              :value="index"
              :label="item"
              :key="'YEARS_KEY_' + index"
            ></el-option>
          </el-select>
          周
          <el-select
            clearable
            size="medium"
            :disabled="d.disabled"
            v-model="d.presentIllnessHistory.useDays"
            placeholder=""
            style="width: 70px"
          >
            <el-option
              v-for="(item, index) in DAYS"
              :value="index"
              :label="item"
              :key="'YEARS_KEY_' + index"
            ></el-option>
          </el-select>
          日
          <el-radio-group
            :disabled="d.disabled"
            v-model="d.presentIllnessHistory.controllerMedicantWork"
          >
            <el-radio size="medium" :label="true" :disabled="d.disabled">
              有效
            </el-radio>
            <el-radio size="medium" :label="false" :disabled="d.disabled">
              无效
            </el-radio>
          </el-radio-group>
          。
        </div>
        <el-input
          size="medium"
          type="textarea"
          :disabled="d.disabled"
          placeholder="补充内容,限制100个字符以内 "
          :maxlength="100"
          :autosize="{ minRows: 1, maxRows: 4 }"
          v-model="d.presentIllnessHistory.others5"
          style="margin-top: 0.5rem"
        ></el-input>
      </template>
      <div>
        两次发作之间是否有完全缓解期
        <el-radio-group
          :disabled="d.disabled"
          v-model="d.presentIllnessHistory.pauseBetweenCause"
        >
          <el-radio size="medium" :label="false" :disabled="d.disabled">
            无
          </el-radio>
          <el-radio size="medium" :label="true" :disabled="d.disabled">
            有
          </el-radio>
        </el-radio-group>
        。
      </div>
    </div>

    <div class="h3">其他(非必选)</div>
    <div class="content-wrapper" :class="{ locked: d.disabled }">
      <div>
        <div style="display: inline-block">胃纳：</div>
        <el-radio-group
          :disabled="d.disabled"
          v-model="d.presentIllnessHistory.appetite"
        >
          <el-radio size="medium" :disabled="d.disabled" label="ususal">
            如常
          </el-radio>
          <el-radio size="medium" :disabled="d.disabled" label="less">
            减少
          </el-radio>
          <el-radio size="medium" :disabled="d.disabled" label="none">
            拒食
          </el-radio>
        </el-radio-group>
      </div>
      <div>
        <div style="display: inline-block">呕吐：</div>
        <el-radio-group
          :disabled="d.disabled"
          v-model="d.presentIllnessHistory.vomit"
          @change="clear('vomitRemark')"
        >
          <el-radio size="medium" :disabled="d.disabled" label="0">无</el-radio>
          <el-radio size="medium" :disabled="d.disabled" label="1">有</el-radio>
        </el-radio-group>
        <el-input
          v-model="d.presentIllnessHistory.vomitRemark"
          v-if="d.presentIllnessHistory.vomit"
          size="small"
          style="width: 180px"
          maxlength="100"
          placeholder="具体异常情况"
          :disabled="d.disabled"
        ></el-input>
      </div>
      <div>
        <div style="display: inline-block">大便：</div>
        <el-radio-group
          :disabled="d.disabled"
          v-model="d.presentIllnessHistory.feces"
          @change="clear('fecesRemark')"
        >
          <el-radio size="medium" :disabled="d.disabled" label="1">
            正常
          </el-radio>
          <el-radio size="medium" :disabled="d.disabled" label="0">
            异常
          </el-radio>
        </el-radio-group>
        <el-input
          v-model="d.presentIllnessHistory.fecesRemark"
          v-if="d.presentIllnessHistory.feces == '0'"
          size="small"
          style="width: 180px"
          maxlength="100"
          placeholder="具体异常情况"
          :disabled="d.disabled"
        ></el-input>
      </div>
      <div>
        <div style="display: inline-block">小便：</div>
        <el-radio-group
          :disabled="d.disabled"
          v-model="d.presentIllnessHistory.urine"
          @change="clear('urineRemark')"
        >
          <el-radio size="medium" :disabled="d.disabled" label="normal">
            正常
          </el-radio>
          <el-radio size="medium" :disabled="d.disabled" label="abnormal">
            异常
          </el-radio>
        </el-radio-group>
        <el-input
          v-model="d.presentIllnessHistory.urineRemark"
          v-if="d.presentIllnessHistory.urine == 'abnormal'"
          size="small"
          style="width: 180px"
          maxlength="100"
          placeholder="具体异常情况"
          :disabled="d.disabled"
        ></el-input>
        <el-input
          size="medium"
          type="textarea"
          :disabled="d.disabled"
          placeholder="补充内容,限制100个字符以内 "
          :maxlength="100"
          :autosize="{ minRows: 1, maxRows: 4 }"
          v-model="d.presentIllnessHistory.others6"
          style="margin-top: 0.5rem"
        ></el-input>
      </div>
    </div>
  </div>
</template>
<script>
  import { reactive, inject } from 'vue'
  import { initPresentIllnessHistory } from './initTools'
  import { isNumber } from '@/utils/validate'
  export default {
    name: 'presentIllnessHistory',
    setup() {
      const d = reactive({
        presentIllnessHistory: initPresentIllnessHistory(),
        disabled: null,
      })

      const autoCheckAsthma = function () {
        console.log('autoCheckAsthma')
      }

      const YEARS = inject('YEARS')
      const MONTHS = inject('MONTHS')
      const DAYS = inject('DAYS')
      const FULLYEARS = inject('FULLYEARS')
      const clearValue = inject('clearValue')
      // const disabled = ref('')
      const ageType = inject('ageType')
      const clear = function (val) {
        clearValue(d.presentIllnessHistory, val)
      }

      const getData = function () {
        return d.presentIllnessHistory
      }

      const valiNumber = function (val) {
        console.log('result =' + isNumber(val))
        return isNumber(val)
      }
      return {
        d,
        autoCheckAsthma,
        YEARS,
        MONTHS,
        DAYS,
        FULLYEARS,
        // disabled,
        clear,
        getData,
        valiNumber,
        ageType,
      }
    },
  }
</script>
<style lang="scss" scoped>
  @import '@/styles/emr.scss';
</style>
